Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autoloader load order issue when including Sage 9 via composer.json in Bedrock #1628

Merged
merged 1 commit into from Apr 3, 2016
Merged

Conversation

henkler
Copy link
Contributor

@henkler henkler commented Mar 25, 2016

The Composer Autoloader has issues with the "files" directive in composer.json when Sage 9 is included as a package in a Bedrock project via the root composer.json.

After diagnosing, I don't see a way the "files" directive can be used in the Sage composer.json and not cause issues with load order. The root composer package (in Bedrock) will see the files directive in the package and automatically attempt to load prior to WordPress.

psr-4 autoloading for Roots\Sage should still work fine in this scenario since these are lazy-loaded.

I've moved the offending 4 files from autoloader back into functions.php the way they were in Sage 8. I'm not sure if there is a more clever way to do this, but it fixes the issue.

@henkler henkler mentioned this pull request Mar 25, 2016
9 tasks
@retlehs retlehs added the 9.0.0 label Apr 3, 2016
@retlehs retlehs merged commit b19cbbf into roots:sage-9 Apr 3, 2016
@retlehs
Copy link
Member

retlehs commented Apr 3, 2016

thanks!

@aaemnnosttv
Copy link
Contributor

@retlehs @henkler You also need to make the require autoload conditional to the existence of the file otherwise this will fatal since that file will not exist if the theme were installed as a composer dependency ;)

@retlehs
Copy link
Member

retlehs commented Apr 3, 2016

@aaemnnosttv thanks 👍 508de7d

@henkler henkler deleted the sage-9 branch April 4, 2016 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants